import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from "../containers/Home"
import News from "../containers/News"
import NotFound from "../containers/NotFound"

// 关联路由
Vue.use(VueRouter)


export default new VueRouter({
    // routers  router  
    routes: [
        // 每一个对象都是一个路由节点
        {
            path: "/home",
            component: Home
        },
        // restfullAPI: /iwen/20 ->  /username/iwen/age/20
        {
            path: "/news/:type/student/:num?",
            name:"News",
            component: News
        },
        {
            path: "*",
            component: NotFound
        }
    ]
})
